
package scm.inventoryControl.entity;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import scm.rawMaterialPurchasing.entity.RawMaterialEntity;


@Entity
public class RMInventoryLevelEntity implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;

    @OneToMany (mappedBy="rmInventoryLevel")
    private List<RawMaterialBatchRecordEntity> rmBatchRecords;
    @OneToOne
    private RawMaterialEntity rawMaterial;
    
   // private int incomingQty;
    private double currentLevel;
    private double safetyStock;
    
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof RMInventoryLevelEntity)) {
            return false;
        }
        RMInventoryLevelEntity other = (RMInventoryLevelEntity) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "inventory.entity.RMInventoryLevel[ id=" + id + " ]";
    }

    public List<RawMaterialBatchRecordEntity> getRmBatchRecords() {
        return rmBatchRecords;
    }

    public void setRmBatchRecords(List<RawMaterialBatchRecordEntity> rmBatchRecords) {
        this.setRmBatchRecords(rmBatchRecords);
    }

//    public int getIncomingQty() {
//        return incomingQty;
//    }
//
//    public void setIncomingQty(int incomingQty) {
//        this.incomingQty = incomingQty;
//    }

    public double getCurrentLevel() {
        return currentLevel;
    }

    public void setCurrentLevel(double currentLevel) {
        this.currentLevel = currentLevel;
    }

    public double getSafetyStock() {
        return safetyStock;
    }

    public void setSafetyStock(double safetyStock) {
        this.safetyStock = safetyStock;
    }


    public RawMaterialEntity getRawMaterial() {
        return rawMaterial;
    }

    public void setRawMaterial(RawMaterialEntity rawMaterial) {
        this.rawMaterial = rawMaterial;
    }

    
}
